<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Class::Accessor - Automated accessor generation - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Class-Accessor - MetaCPAN" href="https://metacpan.org/dist/Class-Accessor/releases.rss" />
        <link rel="canonical" href="./Class::Accessor.html" />
        <meta name="description" content="Automated accessor generation" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Class::Accessor" />
<meta name="twitter:title"       content="Class::Accessor" />
<meta name="twitter:description" content="Automated accessor generation" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Class::Accessor.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Class-Accessor was released.">
      <span class="relatize">22 Oct 2017 17:01:15 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Class-Accessor">Class-Accessor</a>
  </li>
  <li>
    Module version: 0.51
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Class-Accessor/source/lib/Class/Accessor.pm">Source</a>
    (<a href="https://metacpan.org/dist/Class-Accessor/source/lib/Class/Accessor.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Class-Accessor/source/lib/Class">Browse</a>
    (<a href="https://metacpan.org/dist/Class-Accessor/source/lib/Class?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Class-Accessor/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Class-Accessor/contribute">How to Contribute</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Class-Accessor">Issues</a>
      (2)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Class-Accessor+0.51" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/C/Class-Accessor.html?oncpan=1&amp;distmat=1&amp;version=0.51&amp;grade=2" style="color: #090">10515</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/C/Class-Accessor.html?oncpan=1&amp;distmat=1&amp;version=0.51&amp;grade=3" style="color: #900">1</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/C/Class-Accessor.html?oncpan=1&amp;distmat=1&amp;version=0.51&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/KASEI/Class-Accessor-0.51">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Class-Accessor who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Class-Accessor-0.51/index.html">80.73% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Class-Accessor/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/K/KA/KASEI/Class-Accessor-0.51.tar.gz">
      Download (<span itemprop="fileSize">12.71KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FKASEI%2FClass-Accessor-0.51%2Flib%2FClass%2FAccessor.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Class-Accessor/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Class-Accessor/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Class-Accessor">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Class-Accessor">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Class/Accessor.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="KASEI/Class-Accessor-0.51"
>0.51
  (KASEI on 2017-10-22)</option>
<option
  
  value="KASEI/Class-Accessor-0.34"
>0.34
  (KASEI on 2009-09-15)</option>
<optgroup label="BackPAN">'
<option
  
  value="KASEI/Class-Accessor-0.50"
>0.50
  (KASEI on 2017-10-22)</option>
<option
  
  value="KASEI/Class-Accessor-0.33"
>0.33
  (KASEI on 2009-05-04)</option>
<option
  
  value="KASEI/Class-Accessor-0.31"
>0.31
  (KASEI on 2007-07-11)</option>
<option
  
  value="KASEI/Class-Accessor-0.30"
>0.30
  (KASEI on 2006-11-26)</option>
<option
  
  value="KASEI/Class-Accessor-0.27"
>0.27
  (KASEI on 2006-07-19)</option>
<option
  
  value="KASEI/Class-Accessor-0.25"
>0.25
  (KASEI on 2006-03-31)</option>
<option
  
  value="KASEI/Class-Accessor-0.22"
>0.22
  (KASEI on 2005-09-05)</option>
<option
  
  value="KASEI/Class-Accessor-0.21"
>0.21
  (KASEI on 2005-09-01)</option>
<option
  
  value="KASEI/Class-Accessor-0.20"
>0.20
  (KASEI on 2005-09-01)</option>
<option
  
  value="KASEI/Class-Accessor-0.19"
>0.19
  (KASEI on 2004-03-02)</option>
<option
  
  value="KASEI/Class-Accessor-0.18"
>0.18
  (KASEI on 2003-04-03)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.17"
>0.17
  (MSCHWERN on 2001-04-02)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.16"
>0.16
  (MSCHWERN on 2000-12-14)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.15"
>0.15
  (MSCHWERN on 2000-08-18)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.13"
>0.13
  (MSCHWERN on 2000-04-25)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.12"
>0.12
  (MSCHWERN on 2000-04-18)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.11"
>0.11
  (MSCHWERN on 2000-04-17)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.02"
>0.02
  (MSCHWERN on 1999-12-14)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/KASEI/Class-Accessor-0.51/diff/' + encodeURIComponent(this.value) + '/lib/Class/Accessor.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="KASEI/Class-Accessor-0.51"
>0.51
  (KASEI on 2017-10-22)</option>
<option
  
  value="KASEI/Class-Accessor-0.34"
>0.34
  (KASEI on 2009-09-15)</option>
<optgroup label="BackPAN">'
<option
  
  value="KASEI/Class-Accessor-0.50"
>0.50
  (KASEI on 2017-10-22)</option>
<option
  
  value="KASEI/Class-Accessor-0.33"
>0.33
  (KASEI on 2009-05-04)</option>
<option
  
  value="KASEI/Class-Accessor-0.31"
>0.31
  (KASEI on 2007-07-11)</option>
<option
  
  value="KASEI/Class-Accessor-0.30"
>0.30
  (KASEI on 2006-11-26)</option>
<option
  
  value="KASEI/Class-Accessor-0.27"
>0.27
  (KASEI on 2006-07-19)</option>
<option
  
  value="KASEI/Class-Accessor-0.25"
>0.25
  (KASEI on 2006-03-31)</option>
<option
  
  value="KASEI/Class-Accessor-0.22"
>0.22
  (KASEI on 2005-09-05)</option>
<option
  
  value="KASEI/Class-Accessor-0.21"
>0.21
  (KASEI on 2005-09-01)</option>
<option
  
  value="KASEI/Class-Accessor-0.20"
>0.20
  (KASEI on 2005-09-01)</option>
<option
  
  value="KASEI/Class-Accessor-0.19"
>0.19
  (KASEI on 2004-03-02)</option>
<option
  
  value="KASEI/Class-Accessor-0.18"
>0.18
  (KASEI on 2003-04-03)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.17"
>0.17
  (MSCHWERN on 2001-04-02)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.16"
>0.16
  (MSCHWERN on 2000-12-14)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.15"
>0.15
  (MSCHWERN on 2000-08-18)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.13"
>0.13
  (MSCHWERN on 2000-04-25)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.12"
>0.12
  (MSCHWERN on 2000-04-18)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.11"
>0.11
  (MSCHWERN on 2000-04-17)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.02"
>0.02
  (MSCHWERN on 1999-12-14)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/base" title="base" class="ellipsis">base</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Class::Accessor/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Class%3A%3AAccessor">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Class-Accessor">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/KASEI/Class-Accessor-0.51/view/lib/Class/Accessor.pm">This version</a>
    </li>
    <li>
      <a href="./Class::Accessor.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/PINGAN"><img src="https://www.gravatar.com/avatar/a02222e5e0e4fd24d52fc29a08ac6bcb?d=identicon&amp;s=20" title="PINGAN" alt="PINGAN"></a>
<a class="display-all" href="https://metacpan.org/author/KES"><img src="https://www.gravatar.com/avatar/e8530f00b43b4f6a056f8ad4ee52ea47?d=identicon&amp;s=20" title="KES" alt="KES"></a>
<a class="display-all" href="https://metacpan.org/author/ILUX"><img src="https://www.gravatar.com/avatar/1cd0eea5e6ca13346060bb9d2c1e286b?d=identicon&amp;s=20" title="ILUX" alt="ILUX"></a>
<a class="display-all" href="https://metacpan.org/author/MISHIN"><img src="https://www.gravatar.com/avatar/7aefe037fc617ef89780ad89de3deb87?d=identicon&amp;s=20" title="MISHIN" alt="MISHIN"></a>
<a class="display-all" href="https://metacpan.org/author/MJEMMESON"><img src="https://www.gravatar.com/avatar/e17c4cf81cbd75b5043884252c378c47?d=identicon&amp;s=20" title="MJEMMESON" alt="MJEMMESON"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Class-Accessor/plussers">10 PAUSE users</a>
</div>
<div>
    10 non-PAUSE users
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 1 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
      data-contrib-email="marty+perl@martian.org"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Marty Pauley
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/KASEI" class="author-name">Marty Pauley</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Class/Accessor.pm&#39;" class="">
<option
  selected
  value="KASEI/Class-Accessor-0.51"
>0.51
  (KASEI on 2017-10-22)</option>
<option
  
  value="KASEI/Class-Accessor-0.34"
>0.34
  (KASEI on 2009-09-15)</option>
<optgroup label="BackPAN">'
<option
  
  value="KASEI/Class-Accessor-0.50"
>0.50
  (KASEI on 2017-10-22)</option>
<option
  
  value="KASEI/Class-Accessor-0.33"
>0.33
  (KASEI on 2009-05-04)</option>
<option
  
  value="KASEI/Class-Accessor-0.31"
>0.31
  (KASEI on 2007-07-11)</option>
<option
  
  value="KASEI/Class-Accessor-0.30"
>0.30
  (KASEI on 2006-11-26)</option>
<option
  
  value="KASEI/Class-Accessor-0.27"
>0.27
  (KASEI on 2006-07-19)</option>
<option
  
  value="KASEI/Class-Accessor-0.25"
>0.25
  (KASEI on 2006-03-31)</option>
<option
  
  value="KASEI/Class-Accessor-0.22"
>0.22
  (KASEI on 2005-09-05)</option>
<option
  
  value="KASEI/Class-Accessor-0.21"
>0.21
  (KASEI on 2005-09-01)</option>
<option
  
  value="KASEI/Class-Accessor-0.20"
>0.20
  (KASEI on 2005-09-01)</option>
<option
  
  value="KASEI/Class-Accessor-0.19"
>0.19
  (KASEI on 2004-03-02)</option>
<option
  
  value="KASEI/Class-Accessor-0.18"
>0.18
  (KASEI on 2003-04-03)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.17"
>0.17
  (MSCHWERN on 2001-04-02)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.16"
>0.16
  (MSCHWERN on 2000-12-14)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.15"
>0.15
  (MSCHWERN on 2000-08-18)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.13"
>0.13
  (MSCHWERN on 2000-04-25)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.12"
>0.12
  (MSCHWERN on 2000-04-18)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.11"
>0.11
  (MSCHWERN on 2000-04-17)</option>
<option
  
  value="MSCHWERN/Class-Accessor-0.02"
>0.02
  (MSCHWERN on 1999-12-14)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Class-Accessor">Class-Accessor-0.51</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage four &#10;
          • 668 direct dependents &#10;          • 2002 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="15"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Class-Accessor-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Class-Accessor-0.51">
    <input type="hidden" name="author" value="KASEI">
    <input type="hidden" name="distribution" value="Class-Accessor">
    <button type="submit" class="favorite highlight"><span>20</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Class::Accessor.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>20</span> ++</a>
</div>
   / <span>Class::Accessor</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Class::Accessor.html#NAME">NAME</a></li>
  <li><a href="./Class::Accessor.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Class::Accessor.html#DESCRIPTION">DESCRIPTION</a>
    <ul>
      <li><a href="./Class::Accessor.html#Moose-like">Moose-like</a></li>
    </ul>
  </li>
  <li><a href="./Class::Accessor.html#CONSTRUCTOR">CONSTRUCTOR</a>
    <ul>
      <li><a href="./Class::Accessor.html#new">new</a></li>
    </ul>
  </li>
  <li><a href="./Class::Accessor.html#MAKING-ACCESSORS">MAKING ACCESSORS</a>
    <ul>
      <li><a href="./Class::Accessor.html#follow_best_practice">follow_best_practice</a></li>
      <li><a href="./Class::Accessor.html#accessor_name_for-/-mutator_name_for">accessor_name_for / mutator_name_for</a></li>
      <li><a href="./Class::Accessor.html#mk_accessors">mk_accessors</a></li>
      <li><a href="./Class::Accessor.html#mk_ro_accessors">mk_ro_accessors</a></li>
      <li><a href="./Class::Accessor.html#mk_wo_accessors">mk_wo_accessors</a></li>
    </ul>
  </li>
  <li><a href="./Class::Accessor.html#Moose!">Moose!</a></li>
  <li><a href="./Class::Accessor.html#DETAILS">DETAILS</a>
    <ul>
      <li><a href="./Class::Accessor.html#Modifying-the-behavior-of-the-accessor">Modifying the behavior of the accessor</a></li>
      <li><a href="./Class::Accessor.html#set">set</a></li>
      <li><a href="./Class::Accessor.html#get">get</a></li>
      <li><a href="./Class::Accessor.html#make_accessor">make_accessor</a></li>
      <li><a href="./Class::Accessor.html#make_ro_accessor">make_ro_accessor</a></li>
      <li><a href="./Class::Accessor.html#make_wo_accessor">make_wo_accessor</a></li>
    </ul>
  </li>
  <li><a href="./Class::Accessor.html#EXCEPTIONS">EXCEPTIONS</a></li>
  <li><a href="./Class::Accessor.html#EFFICIENCY">EFFICIENCY</a></li>
  <li><a href="./Class::Accessor.html#EXAMPLES">EXAMPLES</a></li>
  <li><a href="./Class::Accessor.html#CAVEATS-AND-TRICKS">CAVEATS AND TRICKS</a>
    <ul>
      <li><a href="./Class::Accessor.html#Don&#39;t-make-a-field-called-DESTROY">Don&#39;t make a field called DESTROY</a></li>
      <li><a href="./Class::Accessor.html#Overriding-autogenerated-accessors">Overriding autogenerated accessors</a></li>
    </ul>
  </li>
  <li><a href="./Class::Accessor.html#AUTHORS">AUTHORS</a>
    <ul>
      <li><a href="./Class::Accessor.html#ORIGINAL-AUTHOR">ORIGINAL AUTHOR</a></li>
      <li><a href="./Class::Accessor.html#THANKS">THANKS</a></li>
    </ul>
  </li>
  <li><a href="./Class::Accessor.html#SEE-ALSO">SEE ALSO</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<pre><code>  Class::Accessor - Automated accessor generation</code></pre>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>  package Foo;
  use base qw(Class::Accessor);
  Foo-&gt;follow_best_practice;
  Foo-&gt;mk_accessors(qw(name role salary));

  # or if you prefer a Moose-like interface...

  package Foo;
  use Class::Accessor &quot;antlers&quot;;
  has name =&gt; ( is =&gt; &quot;rw&quot;, isa =&gt; &quot;Str&quot; );
  has role =&gt; ( is =&gt; &quot;rw&quot;, isa =&gt; &quot;Str&quot; );
  has salary =&gt; ( is =&gt; &quot;rw&quot;, isa =&gt; &quot;Num&quot; );

  # Meanwhile, in a nearby piece of code!
  # Class::Accessor provides new().
  my $mp = Foo-&gt;new({ name =&gt; &quot;Marty&quot;, role =&gt; &quot;JAPH&quot; });

  my $job = $mp-&gt;role;  # gets $mp-&gt;{role}
  $mp-&gt;salary(400000);  # sets $mp-&gt;{salary} = 400000 # I wish

  # like my @info = @{$mp}{qw(name role)}
  my @info = $mp-&gt;get(qw(name role));

  # $mp-&gt;{salary} = 400000
  $mp-&gt;set(&#39;salary&#39;, 400000);</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module automagically generates accessors/mutators for your class.</p>

<p>Most of the time, writing accessors is an exercise in cutting and pasting. You usually wind up with a series of methods like this:</p>

<pre><code>    sub name {
        my $self = shift;
        if(@_) {
            $self-&gt;{name} = $_[0];
        }
        return $self-&gt;{name};
    }

    sub salary {
        my $self = shift;
        if(@_) {
            $self-&gt;{salary} = $_[0];
        }
        return $self-&gt;{salary};
    }

  # etc...</code></pre>

<p>One for each piece of data in your object. While some will be unique, doing value checks and special storage tricks, most will simply be exercises in repetition. Not only is it Bad Style to have a bunch of repetitious code, but it&#39;s also simply not lazy, which is the real tragedy.</p>

<p>If you make your module a subclass of Class::Accessor and declare your accessor fields with mk_accessors() then you&#39;ll find yourself with a set of automatically generated accessors which can even be customized!</p>

<p>The basic set up is very simple:</p>

<pre><code>    package Foo;
    use base qw(Class::Accessor);
    Foo-&gt;mk_accessors( qw(far bar car) );</code></pre>

<p>Done. Foo now has simple far(), bar() and car() accessors defined.</p>

<p>Alternatively, if you want to follow Damian&#39;s <i>best practice</i> guidelines you can use:</p>

<pre><code>    package Foo;
    use base qw(Class::Accessor);
    Foo-&gt;follow_best_practice;
    Foo-&gt;mk_accessors( qw(far bar car) );</code></pre>

<p><b>Note:</b> you must call <code>follow_best_practice</code> before calling <code>mk_accessors</code>.</p>

<h2 id="Moose-like"><a id="Moose"></a>Moose-like</h2>

<p>By popular demand we now have a simple Moose-like interface. You can now do:</p>

<pre><code>    package Foo;
    use Class::Accessor &quot;antlers&quot;;
    has far =&gt; ( is =&gt; &quot;rw&quot; );
    has bar =&gt; ( is =&gt; &quot;rw&quot; );
    has car =&gt; ( is =&gt; &quot;rw&quot; );</code></pre>

<p>Currently only the <code>is</code> attribute is supported.</p>

<h1 id="CONSTRUCTOR">CONSTRUCTOR</h1>

<p>Class::Accessor provides a basic constructor, <code>new</code>. It generates a hash-based object and can be called as either a class method or an object method.</p>

<h2 id="new">new</h2>

<pre><code>    my $obj = Foo-&gt;new;
    my $obj = $other_obj-&gt;new;

    my $obj = Foo-&gt;new(\%fields);
    my $obj = $other_obj-&gt;new(\%fields);</code></pre>

<p>It takes an optional %fields hash which is used to initialize the object (handy if you use read-only accessors). The fields of the hash correspond to the names of your accessors, so...</p>

<pre><code>    package Foo;
    use base qw(Class::Accessor);
    Foo-&gt;mk_accessors(&#39;foo&#39;);

    my $obj = Foo-&gt;new({ foo =&gt; 42 });
    print $obj-&gt;foo;    # 42</code></pre>

<p>however %fields can contain anything, new() will shove them all into your object.</p>

<h1 id="MAKING-ACCESSORS"><a id="MAKING"></a>MAKING ACCESSORS</h1>

<h2 id="follow_best_practice">follow_best_practice</h2>

<p>In Damian&#39;s Perl Best Practices book he recommends separate get and set methods with the prefix set_ and get_ to make it explicit what you intend to do. If you want to create those accessor methods instead of the default ones, call:</p>

<pre><code>    __PACKAGE__-&gt;follow_best_practice</code></pre>

<p><b>before</b> you call any of the accessor-making methods.</p>

<h2 id="accessor_name_for-/-mutator_name_for"><a id="accessor_name_for"></a><a id="accessor_name_for---mutator_name_for"></a>accessor_name_for / mutator_name_for</h2>

<p>You may have your own crazy ideas for the names of the accessors, so you can make those happen by overriding <code>accessor_name_for</code> and <code>mutator_name_for</code> in your subclass. (I copied that idea from Class::DBI.)</p>

<h2 id="mk_accessors">mk_accessors</h2>

<pre><code>    __PACKAGE__-&gt;mk_accessors(@fields);</code></pre>

<p>This creates accessor/mutator methods for each named field given in @fields. Foreach field in @fields it will generate two accessors. One called &quot;field()&quot; and the other called &quot;_field_accessor()&quot;. For example:</p>

<pre><code>    # Generates foo(), _foo_accessor(), bar() and _bar_accessor().
    __PACKAGE__-&gt;mk_accessors(qw(foo bar));</code></pre>

<p>See <a href="https://metacpan.org/pod/CAVEATS&#32;AND&#32;TRICKS#Overriding-autogenerated-accessors">&quot;Overriding autogenerated accessors&quot; in CAVEATS AND TRICKS</a> for details.</p>

<h2 id="mk_ro_accessors">mk_ro_accessors</h2>

<pre><code>  __PACKAGE__-&gt;mk_ro_accessors(@read_only_fields);</code></pre>

<p>Same as mk_accessors() except it will generate read-only accessors (ie. true accessors). If you attempt to set a value with these accessors it will throw an exception. It only uses get() and not set().</p>

<pre><code>    package Foo;
    use base qw(Class::Accessor);
    Foo-&gt;mk_ro_accessors(qw(foo bar));

    # Let&#39;s assume we have an object $foo of class Foo...
    print $foo-&gt;foo;  # ok, prints whatever the value of $foo-&gt;{foo} is
    $foo-&gt;foo(42);    # BOOM!  Naughty you.</code></pre>

<h2 id="mk_wo_accessors">mk_wo_accessors</h2>

<pre><code>  __PACKAGE__-&gt;mk_wo_accessors(@write_only_fields);</code></pre>

<p>Same as mk_accessors() except it will generate write-only accessors (ie. mutators). If you attempt to read a value with these accessors it will throw an exception. It only uses set() and not get().</p>

<p><b>NOTE</b> I&#39;m not entirely sure why this is useful, but I&#39;m sure someone will need it. If you&#39;ve found a use, let me know. Right now it&#39;s here for orthogonality and because it&#39;s easy to implement.</p>

<pre><code>    package Foo;
    use base qw(Class::Accessor);
    Foo-&gt;mk_wo_accessors(qw(foo bar));

    # Let&#39;s assume we have an object $foo of class Foo...
    $foo-&gt;foo(42);      # OK.  Sets $self-&gt;{foo} = 42
    print $foo-&gt;foo;    # BOOM!  Can&#39;t read from this accessor.</code></pre>

<h1 id="Moose!"><a id="Moose1"></a>Moose!</h1>

<p>If you prefer a Moose-like interface to create accessors, you can use <code>has</code> by importing this module like this:</p>

<pre><code>  use Class::Accessor &quot;antlers&quot;;</code></pre>

<p>or</p>

<pre><code>  use Class::Accessor &quot;moose-like&quot;;</code></pre>

<p>Then you can declare accessors like this:</p>

<pre><code>  has alpha =&gt; ( is =&gt; &quot;rw&quot;, isa =&gt; &quot;Str&quot; );
  has beta  =&gt; ( is =&gt; &quot;ro&quot;, isa =&gt; &quot;Str&quot; );
  has gamma =&gt; ( is =&gt; &quot;wo&quot;, isa =&gt; &quot;Str&quot; );</code></pre>

<p>Currently only the <code>is</code> attribute is supported. And our <code>is</code> also supports the &quot;wo&quot; value to make a write-only accessor.</p>

<p>If you are using the Moose-like interface then you should use the <code>extends</code> rather than tweaking your <code>@ISA</code> directly. Basically, replace</p>

<pre><code>  @ISA = qw/Foo Bar/;</code></pre>

<p>with</p>

<pre><code>  extends(qw/Foo Bar/);</code></pre>

<h1 id="DETAILS">DETAILS</h1>

<p>An accessor generated by Class::Accessor looks something like this:</p>

<pre><code>    # Your foo may vary.
    sub foo {
        my($self) = shift;
        if(@_) {    # set
            return $self-&gt;set(&#39;foo&#39;, @_);
        }
        else {
            return $self-&gt;get(&#39;foo&#39;);
        }
    }</code></pre>

<p>Very simple. All it does is determine if you&#39;re wanting to set a value or get a value and calls the appropriate method. Class::Accessor provides default get() and set() methods which your class can override. They&#39;re detailed later.</p>

<h2 id="Modifying-the-behavior-of-the-accessor"><a id="Modifying"></a>Modifying the behavior of the accessor</h2>

<p>Rather than actually modifying the accessor itself, it is much more sensible to simply override the two key methods which the accessor calls. Namely set() and get().</p>

<p>If you -really- want to, you can override make_accessor().</p>

<h2 id="set">set</h2>

<pre><code>    $obj-&gt;set($key, $value);
    $obj-&gt;set($key, @values);</code></pre>

<p>set() defines how generally one stores data in the object.</p>

<p>override this method to change how data is stored by your accessors.</p>

<h2 id="get">get</h2>

<pre><code>    $value  = $obj-&gt;get($key);
    @values = $obj-&gt;get(@keys);</code></pre>

<p>get() defines how data is retrieved from your objects.</p>

<p>override this method to change how it is retrieved.</p>

<h2 id="make_accessor">make_accessor</h2>

<pre><code>    $accessor = __PACKAGE__-&gt;make_accessor($field);</code></pre>

<p>Generates a subroutine reference which acts as an accessor for the given $field. It calls get() and set().</p>

<p>If you wish to change the behavior of your accessors, try overriding get() and set() before you start mucking with make_accessor().</p>

<h2 id="make_ro_accessor">make_ro_accessor</h2>

<pre><code>    $read_only_accessor = __PACKAGE__-&gt;make_ro_accessor($field);</code></pre>

<p>Generates a subroutine reference which acts as a read-only accessor for the given $field. It only calls get().</p>

<p>Override get() to change the behavior of your accessors.</p>

<h2 id="make_wo_accessor">make_wo_accessor</h2>

<pre><code>    $write_only_accessor = __PACKAGE__-&gt;make_wo_accessor($field);</code></pre>

<p>Generates a subroutine reference which acts as a write-only accessor (mutator) for the given $field. It only calls set().</p>

<p>Override set() to change the behavior of your accessors.</p>

<h1 id="EXCEPTIONS">EXCEPTIONS</h1>

<p>If something goes wrong Class::Accessor will warn or die by calling Carp::carp or Carp::croak. If you don&#39;t like this you can override _carp() and _croak() in your subclass and do whatever else you want.</p>

<h1 id="EFFICIENCY">EFFICIENCY</h1>

<p>Class::Accessor does not employ an autoloader, thus it is much faster than you&#39;d think. Its generated methods incur no special penalty over ones you&#39;d write yourself.</p>

<pre><code>  accessors:
              Rate  Basic   Fast Faster Direct
  Basic   367589/s     --   -51%   -55%   -89%
  Fast    747964/s   103%     --    -9%   -77%
  Faster  819199/s   123%    10%     --   -75%
  Direct 3245887/s   783%   334%   296%     --

  mutators:
              Rate    Acc   Fast Faster Direct
  Acc     265564/s     --   -54%   -63%   -91%
  Fast    573439/s   116%     --   -21%   -80%
  Faster  724710/s   173%    26%     --   -75%
  Direct 2860979/s   977%   399%   295%     --</code></pre>

<p>Class::Accessor::Fast is faster than methods written by an average programmer (where &quot;average&quot; is based on Schwern&#39;s example code).</p>

<p>Class::Accessor is slower than average, but more flexible.</p>

<p>Class::Accessor::Faster is even faster than Class::Accessor::Fast. It uses an array internally, not a hash. This could be a good or bad feature depending on your point of view.</p>

<p>Direct hash access is, of course, much faster than all of these, but it provides no encapsulation.</p>

<p>Of course, it&#39;s not as simple as saying &quot;Class::Accessor is slower than average&quot;. These are benchmarks for a simple accessor. If your accessors do any sort of complicated work (such as talking to a database or writing to a file) the time spent doing that work will quickly swamp the time spend just calling the accessor. In that case, Class::Accessor and the ones you write will be roughly the same speed.</p>

<h1 id="EXAMPLES">EXAMPLES</h1>

<p>Here&#39;s an example of generating an accessor for every public field of your class.</p>

<pre><code>    package Altoids;

    use base qw(Class::Accessor Class::Fields);
    use fields qw(curiously strong mints);
    Altoids-&gt;mk_accessors( Altoids-&gt;show_fields(&#39;Public&#39;) );

    sub new {
        my $proto = shift;
        my $class = ref $proto || $proto;
        return fields::new($class);
    }

    my Altoids $tin = Altoids-&gt;new;

    $tin-&gt;curiously(&#39;Curiouser and curiouser&#39;);
    print $tin-&gt;{curiously};    # prints &#39;Curiouser and curiouser&#39;


    # Subclassing works, too.
    package Mint::Snuff;
    use base qw(Altoids);

    my Mint::Snuff $pouch = Mint::Snuff-&gt;new;
    $pouch-&gt;strong(&#39;Blow your head off!&#39;);
    print $pouch-&gt;{strong};     # prints &#39;Blow your head off!&#39;</code></pre>

<p>Here&#39;s a simple example of altering the behavior of your accessors.</p>

<pre><code>    package Foo;
    use base qw(Class::Accessor);
    Foo-&gt;mk_accessors(qw(this that up down));

    sub get {
        my $self = shift;

        # Note every time someone gets some data.
        print STDERR &quot;Getting @_\n&quot;;

        $self-&gt;SUPER::get(@_);
    }

    sub set {
        my ($self, $key) = splice(@_, 0, 2);

        # Note every time someone sets some data.
        print STDERR &quot;Setting $key to @_\n&quot;;

        $self-&gt;SUPER::set($key, @_);
    }</code></pre>

<h1 id="CAVEATS-AND-TRICKS"><a id="CAVEATS"></a>CAVEATS AND TRICKS</h1>

<p>Class::Accessor has to do some internal wackiness to get its job done quickly and efficiently. Because of this, there&#39;s a few tricks and traps one must know about.</p>

<p>Hey, nothing&#39;s perfect.</p>

<h2 id="Don&#39;t-make-a-field-called-DESTROY"><a id="Don"></a><a id="Don-t-make-a-field-called-DESTROY"></a>Don&#39;t make a field called DESTROY</h2>

<p>This is bad. Since DESTROY is a magical method it would be bad for us to define an accessor using that name. Class::Accessor will carp if you try to use it with a field named &quot;DESTROY&quot;.</p>

<h2 id="Overriding-autogenerated-accessors"><a id="Overriding"></a>Overriding autogenerated accessors</h2>

<p>You may want to override the autogenerated accessor with your own, yet have your custom accessor call the default one. For instance, maybe you want to have an accessor which checks its input. Normally, one would expect this to work:</p>

<pre><code>    package Foo;
    use base qw(Class::Accessor);
    Foo-&gt;mk_accessors(qw(email this that whatever));

    # Only accept addresses which look valid.
    sub email {
        my($self) = shift;
        my($email) = @_;

        if( @_ ) {  # Setting
            require Email::Valid;
            unless( Email::Valid-&gt;address($email) ) {
                carp(&quot;$email doesn&#39;t look like a valid address.&quot;);
                return;
            }
        }

        return $self-&gt;SUPER::email(@_);
    }</code></pre>

<p>There&#39;s a subtle problem in the last example, and it&#39;s in this line:</p>

<pre><code>    return $self-&gt;SUPER::email(@_);</code></pre>

<p>If we look at how Foo was defined, it called mk_accessors() which stuck email() right into Foo&#39;s namespace. There *is* no SUPER::email() to delegate to! Two ways around this... first is to make a &quot;pure&quot; base class for Foo. This pure class will generate the accessors and provide the necessary super class for Foo to use:</p>

<pre><code>    package Pure::Organic::Foo;
    use base qw(Class::Accessor);
    Pure::Organic::Foo-&gt;mk_accessors(qw(email this that whatever));

    package Foo;
    use base qw(Pure::Organic::Foo);</code></pre>

<p>And now Foo::email() can override the generated Pure::Organic::Foo::email() and use it as SUPER::email().</p>

<p>This is probably the most obvious solution to everyone but me. Instead, what first made sense to me was for mk_accessors() to define an alias of email(), _email_accessor(). Using this solution, Foo::email() would be written with:</p>

<pre><code>    return $self-&gt;_email_accessor(@_);</code></pre>

<p>instead of the expected SUPER::email().</p>

<h1 id="AUTHORS">AUTHORS</h1>

<p>Copyright 2017 Marty Pauley &lt;marty+perl@martian.org&gt;</p>

<p>This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. That means either (a) the GNU General Public License or (b) the Artistic License.</p>

<h2 id="ORIGINAL-AUTHOR"><a id="ORIGINAL"></a>ORIGINAL AUTHOR</h2>

<p>Michael G Schwern &lt;schwern@pobox.com&gt;</p>

<h2 id="THANKS">THANKS</h2>

<p>Liz and RUZ for performance tweaks.</p>

<p>Tels, for his big feature request/bug report.</p>

<p>Various presenters at YAPC::Asia 2009 for criticising the non-Moose interface.</p>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p>See <a href="https://metacpan.org/pod/Class::Accessor::Fast">Class::Accessor::Fast</a> and <a href="https://metacpan.org/pod/Class::Accessor::Faster">Class::Accessor::Faster</a> if speed is more important than flexibility.</p>

<p>These are some modules which do similar things in different ways <a href="https://metacpan.org/pod/Class::Struct">Class::Struct</a>, <a href="https://metacpan.org/pod/Class::Methodmaker">Class::Methodmaker</a>, <a href="https://metacpan.org/pod/Class::Generate">Class::Generate</a>, <a href="https://metacpan.org/pod/Class::Class">Class::Class</a>, <a href="https://metacpan.org/pod/Class::Contract">Class::Contract</a>, <a href="Moose.html">Moose</a>, <a href="https://metacpan.org/pod/Mouse">Mouse</a></p>

<p>See <a href="https://metacpan.org/pod/Class::DBI">Class::DBI</a> for an example of this module in use.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Class::Accessor, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Class::Accessor</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Class::Accessor</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Class::Accessor.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
